<include file="Public:header" />

<script type="text/javascript" src="__ROOT__/statics/js/kindeditor/kindeditor-min.js"></script>
<script type="text/javascript">
	//编辑器
	KE.show({
		id : 'detail',
		//imageUploadJson : 'index.php?m=attachment&a=keupload',
		//fileManagerJson : 'index.php?m=attachment&a=file_manager&',
		allowFileManager : true,
		afterCreate : function(id) {
			KE.event.ctrl(document, 13, function() {
				KE.util.setData(id);
				document.forms['myform'].submit();
			});
			KE.event.ctrl(KE.g[id].iframeDoc, 13, function() {
				KE.util.setData(id);
				document.forms['myform'].submit();
			});
		}
	});
</script>
<form action="{:u('goods/insert')}" method="post" name="myform" id="myform" enctype="multipart/form-data" >
<div class="pad-10">
<div class="col-tab">
<ul class="tabBut cu-li">
	<li id="tab_setting_1" class="on" onclick="SwapTab('setting','on','',3,1);">{$Think.lang.general_info}</li>
    <li id="tab_setting_2" onclick="SwapTab('setting','on','',3,2);">{$Think.lang.goods_detail}</li>
	<li id="tab_setting_3" onclick="SwapTab('setting','on','',3,3);">{$Think.lang.goods_seo}</li>
</ul>

<div id="div_setting_1" class="contentList pad-10">
<table width="100%" cellpadding="2" cellspacing="1" class="table_form">
	<tr> 
      <th width="100">{$Think.lang.goods_name} :</th>
      <td><input type="text" name="name" id="name" class="input-text" size="60"></td>
    </tr>
    <tr> 
      <th>{$Think.lang.goods_sn} :</th>
      <td><input type="text" name="goods_sn" id="goods_sn" class="input-text"></td>
      </tr>
    <tr> 
      <th>{$Think.lang.goods_cate} :</th>
      <td>
        <select name="cate_id">
        	<volist name="cate_list['parent']" id="val">
        	<option value="{$val.cate_id}">{$val.cate_name}</option>
            	<volist name="cate_list['sub'][$val['cate_id']]" id='sval'>
                <option value="{$sval.cate_id}">&nbsp;&nbsp;&nbsp;&nbsp;{$sval.cate_name}</option>
                </volist>
            </volist>
        </select> 
      </td>
    </tr>
    <tr> 
      <th>{$Think.lang.goods_brand} :</th>
      <td>
        <select name="brand_id">
          	<volist name="brand_list" id="val">
        	<option value="{$val.id}">{$val.name}</option>
            </volist>
        </select> 
      </td>
      </tr>
    <tr> 
      <th>{$Think.lang.shop_price} :</th>
      <td><input type="text" name="sprice" id="sprice" class="input-text"></td>
      </tr>
    <tr> 
      <th>{$Think.lang.market_price} :</th>
      <td><input type="text" name="mprice" id="mprice" class="input-text"></td>
      </tr>
    <tr> 
      <th>{$Think.lang.goods_stock} :</th>
      <td><input type="text" name="stock" id="stock" class="input-text"></td>
    </tr>
    <tr> 
      <th>{$Think.lang.goods_image} :</th>
      <td><input name="image" id="image" type="file" /></td>
    </tr>
</table>
</div>
<div id="div_setting_2" class="contentList pad-10 hidden">
<table width="100%" cellpadding="2" cellspacing="1" class="table_form">
	<tr> 
      <td><textarea name="detail" id="detail" style="width:80%;height:350px;visibility:hidden;"></textarea></td>
    </tr>
</table>
</div>
<div id="div_setting_3" class="contentList pad-10 hidden">
<table width="100%" cellpadding="2" cellspacing="1" class="table_form">
	<tr>
      <th width="100">{$Think.lang.seo_title} :</th>
      <td><input type="text" name="seo_title" id="seo_title" class="input-text" size="60"></td>
    </tr>
    <tr>
      <th>{$Think.lang.seo_keys} :</th>
      <td><input type="text" name="seo_keys" id="seo_keys" class="input-text" size="60"></td>
    </tr>
    <tr>
      <th>{$Think.lang.seo_desc} :</th>
      <td><textarea name="seo_desc" id="seo_desc" cols="80" rows="8"></textarea></td>
    </tr>
</table>
</div>

<div class="bk15"></div>
<div class="btn"><input type="submit" value="{$Think.lang.submit}" name="dosubmit" class="button" id="dosubmit"></div>
</div>
</div>
</form>
<script type="text/javascript">
function SwapTab(name,cls_show,cls_hide,cnt,cur){
    for(i=1;i<=cnt;i++){
		if(i==cur){
			 $('#div_'+name+'_'+i).show();
			 $('#tab_'+name+'_'+i).attr('class',cls_show);
		}else{
			 $('#div_'+name+'_'+i).hide();
			 $('#tab_'+name+'_'+i).attr('class',cls_hide);
		}
	}
}
</script>
</body>
</html>